Page({
  data: {
    animationData:{},
    index:0
  },
  onShow: function () {
    var animation = wx.createAnimation({
      transformOrigin: "50% 50%",
      duration: 1000,
      timingFunction: "ease",
      delay: 0
    })

    this.animation = animation

    animation.right(20);

    this.setData({
      animationData: animation.export()
    })

  },
  ceshi:function(){

    var currentIndex = this.data.index;
    var nextIndex = this.data.index + 1;

    if (currentIndex % 2 == 0){
      this.animation.translateY(-300).step().left(10).step();
    } else {
      this.animation.bottom(100).step().translateY(200).step();
    }

    this.setData({
      animationData: this.animation.export(),
      index: nextIndex
    })
    //console.log(11);
  }

})